namespace Maple.Branch.AuthServer
{
    using AuditLogs;
    using EfCoreConfigurations;
    using Identity;
    using IdentityServer;
    using Microsoft.Extensions.DependencyInjection;
    using Permissions;
    using Settings;
    using Tenants;
    using Volo.Abp.EntityFrameworkCore;
    using Volo.Abp.Modularity;

    [DependsOn(
        typeof(PermissionsEfCoreModule),
        typeof(AuditLogsEfCoreModule),
        typeof(SettingsEfCoreModule),
        typeof(IdentityEfCoreModule),
        //typeof(IdentityAppModule),
        typeof(IdentityServerEfCoreModule),
        typeof(TenantsEfCoreModule),
        typeof(AuthServerCommonModule)
    //typeof(TenantsAppModule)
    )]
    public class AuthServerEfCoreModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();

            context.Services.AddAbpDbContext<AuthServerDbContext>(options =>
            {
                options.AddDefaultRepositories();
            });

            Configure<AbpDbContextOptions>(options =>
            {
                options.UseSqlServer();
            });
        }
    }
}
